package com.kaesar.thread_ressmix.atomic;

/**
 * @Author: chengk
 * @Date: 2021/8/31 12:41 上午
 */
public class Account {
    private volatile int money;

    Account(int initial) {
        this.money = initial;
    }

    public void increMoney() {
        money++;
    }

    public int getMoney() {
        return money;
    }

    @Override
    public String toString() {
        return "Account{" +
                        "money=" + money +
                        '}';
    }
}
